const { Article } = require('../../model/article');
const pagenation = require('mongoose-sex-page');
module.exports = async(req, res) => {
    let page = req.query.page || 1;
    let articles = await pagenation(Article).find().page(page).size(2).display(3).exec();
    console.log(articles);
    res.render('home/default', { result: JSON.parse(JSON.stringify(articles)) });
}